package repository;

import dbConnect.dbConnecter;

import java.sql.SQLException;

public class DeleteRepository {
    public DeleteRepository(){

    }
    public boolean ChangeCheck(int id)  throws SQLException {
        dbConnecter con = new dbConnecter();
        con.getConnection();
        String sql = "Delete  From news Where id="+ dbConnecter.toSqlint(id);
        try {
            int result = con.resultSql(sql);
            if ( result> 0) {
                return true;
            }
            else return false;
        }catch (Exception e) {
            e.printStackTrace();
            return false;
        } finally {
            con.close();
        }
    }
}
